package com.fss.mycomment2.service.impl;

import java.util.List;
import com.fss.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fss.mycomment2.mapper.Mycomment2Mapper;
import com.fss.mycomment2.domain.Mycomment2;
import com.fss.mycomment2.service.IMycomment2Service;

/**
 * 评论Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-23
 */
@Service
public class Mycomment2ServiceImpl implements IMycomment2Service 
{
    @Autowired
    private Mycomment2Mapper mycomment2Mapper;

    /**
     * 查询评论
     * 
     * @param id 评论主键
     * @return 评论
     */
    @Override
    public Mycomment2 selectMycomment2ById(Long id)
    {
        return mycomment2Mapper.selectMycomment2ById(id);
    }

    /**
     * 查询评论列表
     * 
     * @param mycomment2 评论
     * @return 评论
     */
    @Override
    public List<Mycomment2> selectMycomment2List(Mycomment2 mycomment2)
    {
        return mycomment2Mapper.selectMycomment2List(mycomment2);
    }

    /**
     * 新增评论
     * 
     * @param mycomment2 评论
     * @return 结果
     */
    @Override
    public int insertMycomment2(Mycomment2 mycomment2)
    {
        mycomment2.setCreateTime(DateUtils.getNowDate());
        return mycomment2Mapper.insertMycomment2(mycomment2);
    }

    /**
     * 修改评论
     * 
     * @param mycomment2 评论
     * @return 结果
     */
    @Override
    public int updateMycomment2(Mycomment2 mycomment2)
    {
        return mycomment2Mapper.updateMycomment2(mycomment2);
    }

    /**
     * 批量删除评论
     * 
     * @param ids 需要删除的评论主键
     * @return 结果
     */
    @Override
    public int deleteMycomment2ByIds(Long[] ids)
    {
        return mycomment2Mapper.deleteMycomment2ByIds(ids);
    }

    /**
     * 删除评论信息
     * 
     * @param id 评论主键
     * @return 结果
     */
    @Override
    public int deleteMycomment2ById(Long id)
    {
        return mycomment2Mapper.deleteMycomment2ById(id);
    }
}
